const { proxy, stream_url, baseRequest, getFuse } = window._videoFuse;

const handleFuse = async (data) => {
    const $video = this.pageObj.getApiWidgetByAliasName('fuse_modal_video').widgetObj;
    $video.sullivan.closeAll();
    const $loading = this.pageObj.getApiWidgetByAliasName('fuse_modal_loading');
    $loading.showWidget();
    const res = await getFuse(data);
    $loading.hideWidget();
    if (!res) return;
    $video.sullivan.addPlayer({
        ...res,
        playerType: 'webrtc',
        equipmentName: '融合预览',
        url: `${stream_url}/api/v1/stream/rtc/play`
    });
    _videoFuse.canSave = true;
}
const $fuseBtn = this.pageObj.getApiWidgetByAliasName('fuse_btn').widgetObj;
if (!$($fuseBtn.container).find('.fuse-btn').hasClass('layui-btn-disabled')) {
    const $videoSwiper = this.pageObj.getApiWidgetByAliasName('fuse_modal_video_swiper').widgetObj;
    const data = $videoSwiper.sullivan.getData();
    console.log($videoSwiper.sullivan.getData(), 'videoSwiper')
    handleFuse(data);
}